<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.List" import="java.util.ArrayList" import="domain.AllProperty" %>
<%@ page import="repository.AllPropertyDAO" import="java.sql.SQLException" import="java.sql.ResultSet" %>
<%
	List<AllProperty> allProperty = new ArrayList<AllProperty>();

	AllPropertyDAO userDao = null;
	try {
		userDao = new AllPropertyDAO();
	} catch (SQLException e) {
		e.printStackTrace();
	}

	ResultSet rs = userDao.queryAll();
	try {
		while (rs.next()) {
			AllProperty user = new AllProperty();
			user.setID(rs.getString("物品ID"));
			user.setName(rs.getString("物品名称"));
			user.setPrice(rs.getString("物品价格"));
			user.setLocation(rs.getString("所属学院"));
			user.setUse(rs.getString("使用状况"));
			user.setNumber(rs.getString("数量"));
			allProperty.add(user);
		}
	} catch (SQLException e) {
		e.printStackTrace();
	}

	request.setAttribute("propertySco", allProperty);
	request.getRequestDispatcher("AllProperty.jsp").forward(request, response);
%>
